import React from 'react';
import {
  Dialog,
  DialogActions,
  DialogContent,
  DialogContentText,
  DialogTitle,
  Button,
} from '@mui/material';

function ExitConfirmDialog({ open, onClose, onConfirm }) {
  return (
    <Dialog
      open={open}
      onClose={onClose}
      aria-labelledby="exit-dialog-title"
      aria-describedby="exit-dialog-description"
    >
      <DialogTitle id="exit-dialog-title">确认退出</DialogTitle>
      <DialogContent>
        <DialogContentText id="exit-dialog-description">
          当前有正在下载的任务，退出程序将暂停所有下载。是否确认退出？
        </DialogContentText>
      </DialogContent>
      <DialogActions>
        <Button onClick={onClose}>取消</Button>
        <Button onClick={onConfirm} color="primary" autoFocus>
          确认退出
        </Button>
      </DialogActions>
    </Dialog>
  );
}

export default ExitConfirmDialog;